// load data
use data/main_file.dta, clear

// create figure A1
reghdfe Chavismo 								 						/// 
		ib(2010).year##c.log_den ib(2010).year##c.log_pov				///
		ib(2010).year##c.baseline_ch 									///
		ib(2010).year#c.sh_urbano										/// 
		ib(2010).year##i.visited##i.focal [aw = log_pop], 				///
		vce(cluster loc) absorb(loc i.edo##i.year)	
		
preserve
	parmest, label format(estimate min95 max95 p %8.2f p %8.1e) ///
	list(parm label estimate min95 max95 p,clean noobs) ///
	saving(temp.dta)
	use temp.dta, clear
	erase temp.dta
	keep if p != . | _n == 99
	keep if _n >= 43 &  _n != _N
	replace parm = substr(parm, 1, 4)
	destring parm, replace
	rename parm year

	twoway (rline min95 max95 year, color(gs07) lpattern(dot)) ///
			(connected estimate year, color(gs01)) ///
			, legend(off) yline(0) xline(2010) xtitle(Year) ///
			ytitle("Effect of Focal * Visited on Chavista vote")
	graph export figs/F0A1.png, replace
restore	
